/*
 * @Author: your name
 * @Date: 2021-11-05 10:02:05
 * @LastEditTime: 2021-11-16 14:00:10
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \macc.admin.vue\src\projectCommon\store\modules\ports\index.js
 */
const state = {
  portSelect: [],
  iconMap: {},
  descMap: {},
  hasChange: false, //面板数据是否发生改变
};
const mutations = {
  SET_PORSEL(state, payload) {
    state.portSelect = payload;
  },
  SET_ICONMAP(state, payload) {
    state.iconMap = payload;
  },
  SET_DESCMAP(state, payload) {
    state.descMap = payload;
  },
  SET_PORTCHANG(state, payload) {
    state.hasChange = payload;
  },
};
const actions = {
  setPortSelect({ commit }, status) {
    commit('SET_PORSEL', status);
  },
  setIconMap({ commit }, status) {
    commit('SET_ICONMAP', status);
  },
  setDescMap({ commit }, status) {
    commit('SET_DESCMAP', status);
  },
  setPortChange({ commit }, status) {
    commit('SET_PORTCHANG', status);
  },
};
const getters = {
  getSelect: (state) => state.portSelect,
  getIconmap: (state) => state.iconMap,
  getDescmap: (state) => state.descMap,
  getPortChange: (state) => state.hasChange,
};
export default {
  namespaced: true, //开启命名空间，更好的区分使用stage,防止不同stage模块中的方法重名
  state,
  getters,
  mutations,
  actions,
};
